#include <stdio.h>

int main(void)
{
    int hour1, hour2, minute;

    printf("Enter a 24-hour time: ");
    scanf("%d:%d", &hour1, &minute);

    if (hour1 > 12) {
        hour2 = hour1 - 12;
        printf("Equivalent 12-hour time: %.2d:%d PM", hour2, minute);
    }
    else {
        hour2 = hour1;
        printf("Equivalent 12-hour time: %.2d:%d AM", hour2, minute);
    }

    return 0;
}